<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="vm">
        <h2>vuejs版本的计数器----作者：XXXX</h2>
        <button v-on:click="add()" v-bind:disabled="isAddDisabled">+</button>{{result}}<button>-</button>
    </div>

    <script src="./vue.js"></script>
    <script>
        let vueObj=new Vue({
            el:'#vm',
            data:{
                result:3,
                isAddDisabled:false,
                isSubDisabled:false
            },
            methods:{
                add:function(){
                    if(this.result<10){
                        this.result++;
                    }else{
                        this.isAddDisabled=true;
                    }                    
                }
            }
        });
    </script>
</body>
</html>